
function validateForm() 
{
    var x = document.forms["myForm"]["fname"];
    for (let i = 0; i < x.length; i++) 
    {

        if (x[i].value== null || x[i].value == "") 
        {
            alert("需要输入名字。");
        }
    }
   
    var y = document.forms["myForm"]["email"].value;
    var aite = y.indexOf("@");
    var dog =y.lastIndexOf(".");
    if(aite<1 || dog<aite+2|| dog+2>y.length)
    {
        alert("输入有问题");
        return
    }
}

